package com.zrrd.learn.chapter10;

import java.io.File;
import java.util.Objects;

/**
 * IO流
 *
 * @author asus
 * @version 1.0
 * @date 2023/8/21 14:01
 */
public class IO {

    public static void printFileName(File target) {
        if (target.isFile()) {
            System.out.println(target.getName() + "-->文件名称");
        } else {
            File[] fs = target.listFiles();
            if (Objects.nonNull(fs)) {
                for (File f : fs) {
                    printFileName(f);
                }
            }
        }
    }


    public static void main(String[] args) {

        printFileName(new File("C:\\Users\\asus\\Desktop"));


    }
}
